import request from "@/utils/request";
import  {Carts} from './interface/index'
enum Api {
    getShopCart='/api/cart/cartList',  //加上api
    getCartIsChecked='/api/cart/checkCart',
    deleteCart='/api/cart/deleteCar'

}
//获取ShopCart数据
export const getShopCartApi = () =>{
    return request.get<any,Carts>(Api.getShopCart)
}

//切换商品选中状态
export const getCartIsCheckedApi= (skuID:number,isChecked:string) =>{
    return request.get<any,null>(`${Api.getCartIsChecked}/${skuID}/${isChecked}`)

}

//删除商品
export const deleteCartApi= (skuID:number) =>{
    return request.get<any,null>(`${Api.getCartIsChecked}/${skuID}`)

}